package com.efesco.common;

import java.util.TimerTask;

import com.bstek.dorado.data.db.DBStatement;
import com.bstek.dorado.utils.variant.VariantSet;
import com.efesco.common.businessRemind.ServiceReject;

public class TaskDeal extends TimerTask {
	public void run() {
		innerTaskDeal itd = new innerTaskDeal();
		itd = null;
		System.gc();
	}

	class innerTaskDeal {
		private innerTaskDeal() {
			DBStatement dbs = new DBStatement();
			dbs.setSql(" select * from s_em_card_habitation ech where to_char(add_months(sysdate,0),'yyyyMM')=to_char(ech.finish_date,'yyyyMM') ");

			ServiceReject rj = new ServiceReject();
			try {
				java.util.List list = dbs.queryForList();
				dbs
						.setSql(" select * from s_fe_remind fr where fr.remind_type=201");
				java.util.List list2 = dbs.queryForList();
				for (int i = 0; i < list.size(); i++) {
					VariantSet var = (VariantSet) list.get(i);
					for (int j = 0; j < list2.size(); j++) {
						VariantSet var2 = (VariantSet) list.get(j);
						rj.serviceRejectRemind(var.getString("EMPLOYEE_ID"),
								var.getString("SINGLE_COMPANY_ID"), 201, var2
										.getString("fe_employee_id"), var2
										.getString("Content"));
					}
				}
			} catch (Exception e) {
				System.out.println(e.getMessage());
			} finally {
				dbs.close();
			}
		}

	}

}
